package com.itboye.hutouben.util;



import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;

import com.itboye.hutouben.R;

public class SelectImageView extends FrameLayout {


    public ImageView iv;

    public View isselect;
    public SelectImageView(Context context) {
        super(context);
        init();
    }

    public SelectImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public SelectImageView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init();
    }

    private void init() {
        LayoutInflater.from(getContext()).inflate(R.layout.item_photoselect_view, this,true);

        iv= (ImageView) findViewById(R.id.img);
        isselect=findViewById(R.id.isselect);

        iv.setScaleType(ScaleType.CENTER_CROP);
    }




    public void setSelectViewSelected(boolean selected) {
        // TODO Auto-generated method stub
        if (selected) {
            isselect.setBackgroundDrawable(getResources().getDrawable(R.drawable.checkbox_checked));
        }else{
            isselect.setBackgroundDrawable(getResources().getDrawable(R.drawable.checkbox_normal));
        }

    }

}
